import Vue from 'vue'
import Router from 'vue-router'
import SettingView from "../views/SettingView";
import LoginView from "../views/LoginView";
import SignInView from "../views/SignInView";
import HomeView from "../views/HomeView";
import ConversationView from "../views/ConversationView";
import ContactView from "../views/ContactView";

Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/',
            title: 'login',
            component: LoginView
        },
        {
            path: '*',
            redirect: '/'
        },
        {
            path: '/home',
            title: 'home',
            component: HomeView,
            children: [
                {
                    path: 'conversation/:id',
                    title: 'conversation',
                    component: ConversationView,
                },
                {
                    path: 'contact',
                    title: 'contact',
                    component: ContactView,
                },
                {
                    path: 'setting',
                    title: 'setting',
                    component: SettingView,
                }
            ]
        },
        {
            path: '/signin',
            title: 'signin',
            component: SignInView,
        },
    ]
})
